<?php

class cntrlreset implements viewController {

	private $area;
	private $side;
	private $dependencies = array("CSS" => array("hideSidebar.css"), "JavaScript" => array("resetPassword.js") );
	private $pageName = "Account activation";

	public function __construct(user &$userObj){
		parse_str( $_GET['act'] );
		
		// Has the invite string been set
		if(isset($i)){
		
			// Does the hash match a hash in the system?	
			$user = invite::match_hash($i);
			
			// If its not in the system give the user an error page
			if(is_null($user)) header("Location: error?id=3");
			
			// Show the user a page where they can change their password
			
			$this->area = new template('area.resetPassword');
			
			$this->area->replace("iVal", $i);
			
		} else {
			header("Location: home");
		}
	}
	
	
	public function getSide(){
		return $this->side;
	}
	
	public function getArea(){
		return $this->area;
	}
	
	public function getDependencies(){
		return $this->dependencies;
	}

	public function getPageName(){
		return $this->pageName;
	}
	
	public function getTools(){
		return "";
	}	
	
}

?>